<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"www.lixiaofei.cn","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":true,"storage":true,"lazyload":true,"nav":{"valine":{"order":-1}}},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="小孩又闹着不去幼儿园了，我得想个办法让他体会到学习的快乐和意义……">
<meta property="og:type" content="article">
<meta property="og:title" content="与其说教，不如一起写个游戏">
<meta property="og:url" content="http://www.lixiaofei.cn/2021-05-27-a-simple-game/index.html">
<meta property="og:site_name" content="管窥程序">
<meta property="og:description" content="小孩又闹着不去幼儿园了，我得想个办法让他体会到学习的快乐和意义……">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://www.lixiaofei.cn/images/2021/05/guess-number/00.png">
<meta property="og:image" content="http://www.lixiaofei.cn/images/2021/05/guess-number/01.png">
<meta property="og:image" content="http://www.lixiaofei.cn/images/2021/05/guess-number/02.png">
<meta property="og:image" content="http://www.lixiaofei.cn/images/2021/05/guess-number/03.png">
<meta property="og:image" content="http://www.lixiaofei.cn/images/2021/05/guess-number/04.png">
<meta property="article:published_time" content="2021-05-27T02:58:25.851Z">
<meta property="article:modified_time" content="2021-05-28T09:55:36.184Z">
<meta property="article:author" content="太阳雪">
<meta property="article:tag" content="育儿">
<meta property="article:tag" content="编程">
<meta property="article:tag" content="游戏">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://www.lixiaofei.cn/images/2021/05/guess-number/00.png">

<link rel="canonical" href="http://www.lixiaofei.cn/2021-05-27-a-simple-game/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>与其说教，不如一起写个游戏 | 管窥程序</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">管窥程序</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Today is a gift</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/alisx" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://www.lixiaofei.cn/2021-05-27-a-simple-game/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="太阳雪">
      <meta itemprop="description" content="总结 技术 思考 想法">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="管窥程序">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          与其说教，不如一起写个游戏
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-05-27 10:58:25" itemprop="dateCreated datePublished" datetime="2021-05-27T10:58:25+08:00">2021-05-27</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-05-28 17:55:36" itemprop="dateModified" datetime="2021-05-28T17:55:36+08:00">2021-05-28</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/python/" itemprop="url" rel="index"><span itemprop="name">python</span></a>
                </span>
            </span>

          
            <span id="/2021-05-27-a-simple-game/" class="post-meta-item leancloud_visitors" data-flag-title="与其说教，不如一起写个游戏" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021-05-27-a-simple-game/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021-05-27-a-simple-game/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p><img src="../images/2021/05/guess-number/00.png" alt="标题图"></p>
<p>小孩又闹着不去幼儿园了，我得想个办法让他体会到学习的快乐和意义……</p>
<a id="more"></a>
<h2 id="带娃真难">带娃真难</h2>
<p>玩了一个周末，玩舒服了，周一起床后，一听要去学校，就不干了，死活不去，对我们各种撒（威）泼（逼）打（利）滚（诱），实在招架不住，只能妥协了，虽然我可以扛起他，塞进校车里，但受过良好教育（疏于管教）的我不会这么做的，于是打算请个假，好好教育一下，不让此类事件再次发生，如何操作呢……</p>
<p>小家伙一看我妥协了，就像通了电的马达，立马活奔乱跳了起来，拿出各种玩具，拉着我陪他一起玩~  哎</p>
<p>不一会儿，看见我玩的心不在焉，一直看手机（得看看老板有没找事呀），跑过来，说：“爸爸，我要玩你手机上的游戏……”</p>
<p>不去上学还要玩游戏，我这个气就不打一处来呀，正要发作，转念一想，有了</p>
<p>转怒为喜，“你是想玩游戏呀，不如咱们一起做个游戏玩，好不好？”</p>
<p>“好呀，好呀……”，孩子边说着，迫不及待地跑去将自己要做游戏的事告诉奶奶</p>
<p>我一看有门，打开电脑，叫他过来，编写他人生的第一个游戏，说不定，他以后是个游戏开放大神呢，我的天呐……</p>
<p>孩子一看能和爸爸一起编程玩，兴奋极了，因为平常只有我一趴在电脑上，就让他滚的远远的~</p>
<h2 id="灵感乍现">灵感乍现</h2>
<p>前两天，我和他玩了一个猜数字的游戏，在纸上写个数字，然后让对方猜，猜错提示大了还是小了，一般有猜三次猜的机会，不如就做实现这个，不错</p>
<p>有了思路实现就简单了，随机产生一个 10 以内的数字，然后提示输入，判断大小给出提示，然后继续，第一版代码如下：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> random</span><br><span class="line"></span><br><span class="line">num = random.randint(<span class="number">0</span>,<span class="number">10</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">while</span>(<span class="literal">True</span>):</span><br><span class="line">  n = input(<span class="string">"请输入："</span>)</span><br><span class="line">  n = int(n)</span><br><span class="line">  <span class="keyword">if</span> num == n:</span><br><span class="line">      print(<span class="string">"你赢啦！！！\n\n"</span>)</span><br><span class="line">      <span class="keyword">break</span></span><br><span class="line">  <span class="keyword">elif</span> num &lt; n:</span><br><span class="line">      print(<span class="string">"你的太大了"</span>)</span><br><span class="line">  <span class="keyword">else</span>:</span><br><span class="line">      print(<span class="string">"你的太小了"</span>)</span><br></pre></td></tr></table></figure>
<p>赶紧试试，效果还不错哈哈</p>
<p><img src="../images/2021/05/guess-number/01.png" alt=""></p>
<h2 id="迭代……">迭代……</h2>
<p>然后让孩子自己玩一下，开始还不知道按哪个键，也不知输入后需要按回车，教会他后，他小心翼翼地玩了起来</p>
<h3 id="v0-2">v0.2</h3>
<p>不过问题来了，上幼儿园的孩子，不认识字，于是趁机教了他认识 “大” 和 “小”，在修改一下提示，把 “你的太大/小了”，直接改成，“大” 和 “小”，以便他能分辨清楚，至于其他的就让他猜吧</p>
<p>现在他可以自己玩了，太有成就感了，主要是因为教会了他两个字，哈哈，我真是天才~</p>
<h3 id="v0-3">v0.3</h3>
<p>“爸爸，这是什么意思？”，孩子的一句话把我拉了回来，定眼一瞧，原来出错了</p>
<p><img src="../images/2021/05/guess-number/02.png" alt=""></p>
<p>他输入了一个非数字，代码将其转化为整数时出错了，小菜一碟，加个判断就好了</p>
<p>不过还可以加些好玩的东西，于是做了如下改善：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">import</span> random</span><br><span class="line"></span><br><span class="line"><span class="comment"># 输入出错时的表情</span></span><br><span class="line">anger_face = [<span class="string">"ಠ_ಠ"</span>,<span class="string">"ノಠ_ಠノ"</span>,<span class="string">"(¬_¬)"</span>, <span class="string">"(┳◇┳)"</span>,<span class="string">"(◔ д◔)"</span>,<span class="string">"(ʘдʘ╬)"</span>,<span class="string">"(눈_눈)"</span>,<span class="string">"-`д´-"</span>]</span><br><span class="line"></span><br><span class="line">num = random.randint(<span class="number">0</span>,<span class="number">10</span>)</span><br><span class="line"><span class="keyword">while</span>(<span class="literal">True</span>):</span><br><span class="line">  n = input(<span class="string">"请输入："</span>)</span><br><span class="line">  <span class="keyword">if</span> <span class="keyword">not</span> n.isdecimal():  <span class="comment">## 检验输入是否正确</span></span><br><span class="line">      print(random.choice(anger_face))</span><br><span class="line">      <span class="keyword">continue</span></span><br><span class="line"></span><br><span class="line">  n = int(n)</span><br><span class="line">  <span class="keyword">if</span> num == n:</span><br><span class="line">      print(<span class="string">"你赢啦！！！\n\n"</span>)</span><br><span class="line">      <span class="keyword">break</span></span><br><span class="line">  <span class="keyword">elif</span> num &lt; n:</span><br><span class="line">      print(<span class="string">"大"</span>)</span><br><span class="line">  <span class="keyword">else</span>:</span><br><span class="line">      print(<span class="string">"小"</span>)</span><br></pre></td></tr></table></figure>
<ul>
<li>
<p>首先去网上找一下 <a href="http://tw.emoticonfun.com/angry-mad/" target="_blank" rel="noopener">愤怒的文字表情</a>，找一下有意思的，作为随机表情列表；</p>
</li>
<li>
<p>然后用字符串函数 <code>isdecimal</code> 判断输入是否为数字，如果不是就重新输入</p>
</li>
</ul>
<p>改善后玩起来好多了：</p>
<p><img src="../images/2021/05/guess-number/03.png" alt=""></p>
<p>不过，现在画风变成了他故意输错 （─.─||）</p>
<h3 id="v0-4">v0.4</h3>
<p>突然，孩子又说 “爸爸，游戏坏了~”</p>
<p>又出什么 bug 了，凑近一看，哈哈，原来他偶尔猜对了，程序结束，不能玩了</p>
<p>这可不行，退出了还得让我重启，这得改，一顿折腾，好了：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> random</span><br><span class="line"></span><br><span class="line">anger_face = [<span class="string">"ಠ_ಠ"</span>,<span class="string">"ノಠ_ಠノ"</span>,<span class="string">"(¬_¬)"</span>, <span class="string">"(┳◇┳)"</span>,<span class="string">"(◔ д◔)"</span>,<span class="string">"(ʘдʘ╬)"</span>,<span class="string">"(눈_눈)"</span>,<span class="string">"-`д´-"</span>]</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">game</span><span class="params">()</span>:</span></span><br><span class="line">    print(<span class="string">"( ＾∀＾）／欢迎＼( ＾∀＾）"</span>)</span><br><span class="line">    num = random.randint(<span class="number">0</span>,<span class="number">10</span>)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">while</span>(<span class="literal">True</span>):</span><br><span class="line">        n = input(<span class="string">"&gt;&gt;&gt;&gt;："</span>)</span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> n.isdecimal():</span><br><span class="line">            print(random.choice(anger_face))</span><br><span class="line">            <span class="keyword">continue</span></span><br><span class="line"></span><br><span class="line">        n = int(n)</span><br><span class="line">        <span class="keyword">if</span> num == n:</span><br><span class="line">            print(<span class="string">"✌('ω')\n\n"</span>)</span><br><span class="line">            <span class="keyword">break</span></span><br><span class="line">        <span class="keyword">elif</span> num &lt; n:</span><br><span class="line">            print(<span class="string">"大"</span>)</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            print(<span class="string">"小"</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">while</span>(<span class="literal">True</span>):</span><br><span class="line">    game()</span><br><span class="line">    c = input(<span class="string">"再来一把 (y)/n?"</span>)</span><br><span class="line">    <span class="keyword">if</span> c == <span class="string">"n"</span>:</span><br><span class="line">        print(<span class="string">"(ToT)/~~~"</span>)</span><br><span class="line">        <span class="keyword">break</span></span><br></pre></td></tr></table></figure>
<ul>
<li>
<p>首先将原来的代码封装为一个函数 <code>game</code></p>
</li>
<li>
<p>然后写一个死循环，其中先调一下 <code>game</code>，即，一上来游戏就开始</p>
</li>
<li>
<p>结束之后询问是否继续</p>
</li>
</ul>
<p>逻辑很简单</p>
<p>这下他能玩好久了哈哈</p>
<p><img src="../images/2021/05/guess-number/04.png" alt=""></p>
<h3 id="v0-n">v0.n</h3>
<p>正想拿起手机刷刷视频，就听见孩子说：“爸爸，怎么退出……”</p>
<p>我去…… 客户又加需求了……</p>
<p>就这样，可以一直迭代下去，孩子参与其中乐此不疲……</p>
<h2 id="总结">总结</h2>
<p>那一天在游戏中愉快的度过了，孩子已经开始愿意去幼儿园了</p>
<p>是因为我引导的好吗？还是因为创作游戏激发了他学习的兴趣？</p>
<p>其实都不是，至少说不是主要的原因，我觉得最重要的是，他 <strong>感受到了全情投入的陪伴，感受到了安全感和关爱，还有参与其中的价值感</strong></p>
<p>现在，让我们每个人都像高速旋转的陀螺，对身边的人的缺乏关爱和陪伴</p>
<p>无论你给他们什么物质上的补偿，都不如真切地陪伴，而我们自己也从中得到了认可和价值感</p>
<p>当然，如果你会编程，能写游戏，会更好玩~ 比心</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E8%82%B2%E5%84%BF/" rel="tag"># 育儿</a>
              <a href="/tags/%E7%BC%96%E7%A8%8B/" rel="tag"># 编程</a>
              <a href="/tags/%E6%B8%B8%E6%88%8F/" rel="tag"># 游戏</a>
          </div>

        

			<div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/images/wechat-qcode.png" alt="太阳雪 wechat" style="width: 200px; max-width: 100%;"/>
    <div>关注我，获得更多精彩内容</div>
</div>

        
		
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021-05-25-we-have-to-invest/" rel="prev" title="为什么你必须做投资">
      <i class="fa fa-chevron-left"></i> 为什么你必须做投资
    </a></div>
      <div class="post-nav-item">
    <a href="/2021-06-04-binlog2sql/" rel="next" title="妈妈再也不用担心我把数据弄丢了">
      妈妈再也不用担心我把数据弄丢了 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#带娃真难"><span class="nav-number">1.</span> <span class="nav-text">带娃真难</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#灵感乍现"><span class="nav-number">2.</span> <span class="nav-text">灵感乍现</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#迭代……"><span class="nav-number">3.</span> <span class="nav-text">迭代……</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#v0-2"><span class="nav-number">3.1.</span> <span class="nav-text">v0.2</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#v0-3"><span class="nav-number">3.2.</span> <span class="nav-text">v0.3</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#v0-4"><span class="nav-number">3.3.</span> <span class="nav-text">v0.4</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#v0-n"><span class="nav-number">3.4.</span> <span class="nav-text">v0.n</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#总结"><span class="nav-number">4.</span> <span class="nav-text">总结</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="太阳雪"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">太阳雪</p>
  <div class="site-description" itemprop="description">总结 技术 思考 想法</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">88</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">47</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">太阳雪</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://mist.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Mist</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>















  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'teRj7yeJj0xpfGKLJ5uFdbIu-gzGzoHsz',
      appKey     : '3uie0p1nxouCCnkjiXTEBeLd',
      placeholder: "您的关注是我的动力",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
